Micron Document
`*This page is under heavy construction and may be outdated – most fields are considered experimental!`*

Common for all fields is that `F0af`_`[LXMF`:/page/wiki.mu`path=LXMF]`_`f handles binary packing before sending. All fields must be passed in the specified format, often as a `B100`F9d9list`f`b with specific fields. Internally, LXMF uses MessagePack to pack data, so it can be efficiently transferred over the air/wire by Reticulum.

>>Contents

• `F0af`_`[Embedded LXMs`#embedded-lxms]`_`f
• `F0af`_`[Telemetry`#telemetry]`_`f
• `F0af`_`[Telemetry stream`#telemetry-stream]`_`f
• `F0af`_`[Appearance`#appearance]`_`f
• `F0af`_`[File attachment`#file-attachment]`_`f
• `F0af`_`[Image attachment`#image-attachment]`_`f
• `F0af`_`[Audio attachment`#audio-attachment]`_`f
• `F0af`_`[Thread`#thread]`_`f
• `F0af`_`[Commands`#commands]`_`f
• `F0af`_`[Results`#results]`_`f
• `F0af`_`[Group`#group]`_`f
• `F0af`_`[See also`#see-also]`_`f

>>Embedded LXMs

`*Not yet fully implemented, and spec is likely to change.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_EMBEDDED_LXMS | 0x01 | | |
`t

>>Telemetry

`*See the Sideband application source code for telemetry format info.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_TELEMETRY | 0x02 | Node telemetry, all enabled sensors | |
`t

>>Telemetry stream

`*See the Sideband application source code for telemetry format info.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_TELEMETRY_STREAM | 0x03 | Aggregated downstream telemetry for bulk transfer | |
`t

>>Appearance

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| LXMF.FIELD_ICON_APPEARANCE | 0x04 | Defines the icon that represents this node on the situation map. | [string ICON, byte[3] FG_COLOR, byte[3] BG_COLOR] |
`t

Icon is a string with the name of a Material symbol. Searchable list

FG/BG color is an RGB color code from 000000 to FFFFFF.

>>>>Example code

`B100`F9d9# Displays a yellow hiker on a blue background`f`b
`B100`F9d9lxm_fields = { LXMF.FIELD_ICON_APPEARANCE: ["hiking",\\xff\\xff\\x00,\\x00\\x00\\xff] }`f`b
`B100`F9d9lxm = LXMF.LXMessage(dest, source, message_content, desired_method=LXMF.LXMessage.DIRECT, fields=lxm_fields)`f`b

>>File attachment

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_FILE_ATTACHMENTS | 0x05 | List of file attachments | See example |
`t

>>>>Example code

`B100`F9d9# Attach a file`f`b
`B100`F9d9file_name = "some_file.pdf"`f`b
`B100`F9d9with open(file_name, "rb") as att_file:`f`b
`B100`F9d9 file_attachment_1 = [file_name, att_file.read()]`f`b
`B100`F9d9 lxm_fields = { LXMF.FIELD_FILE_ATTACHMENTS: [file_attachment_1] }`f`b
`B100`F9d9 lxm = LXMF.LXMessage(dest, source, message_content, desired_method=LXMF.LXMessage.DIRECT, fields=lxm_fields)`f`b

>>Image attachment

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_IMAGE | 0x06 | Image container | See example |
`t

`B100`F9d9# Include an image`f`b
`B100`F9d9image = ["webp", image_data]`f`b
`B100`F9d9lxm_fields = { LXMF.FIELD_IMAGE: image }`f`b
`B100`F9d9lxm = LXMF.LXMessage(dest, source, message_content, desired_method=LXMF.LXMessage.DIRECT, fields=lxm_fields)`f`b

>>Audio attachment

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_AUDIO | 0x07 | Audio container for non-realtime purposes | See example |
`t

See https://github.com/markqvist/LXMF/blob/master/LXMF/LXMF.py for available audio modes.

`B100`F9d9# Audio fields are a list with two entries of:`f`b
`B100`F9d9# - The audio mode in use, from one of the available modes`f`b
`B100`F9d9# - The audio data encoded according to the specified mode`f`b
`B100`F9d9audio = [LXMF.AM_CODEC2_2400, audio_data]`f`b
`B100`F9d9lxm_fields = { LXMF.FIELD_AUDIO: audio }`f`b
`B100`F9d9lxm = LXMF.LXMessage(dest, source, message_content, desired_method=LXMF.LXMessage.DIRECT, fields=lxm_fields)`f`b

>>Thread

`*Not yet fully implemented, and spec is likely to change.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_THREAD | 0x08 | | |
`t

>>Commands

`*See the Sideband application source code for command/result format info.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_COMMANDS | 0x09 | Direct commands | |
`t

Custom commands are sent in this field. Built in commands include: `B100`F9d9Ping`f`b `B100`F9d9Echo`f`b `B100`F9d9Signal`f`b

>>Results

`*See the Sideband application source code for command/result format info.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_RESULTS | 0x0A | | |
`t

>>Group

`*Not yet fully implemented, and spec is likely to change.`*

`t
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_GROUP | 0x0B | | |
`t

>>See also

• `F0af`_`[LXMF`:/page/wiki.mu`path=LXMF]`_`f
• Structure in the repository's README